﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AddCourseList.aspx.cs" Inherits="CourseListManagement_AddCourseList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="../Css/ys.css" rel="stylesheet" type="text/css" />
    <script language="javascript" src="../My97DatePicker/WdatePicker.js"></script>
    <script language="javascript" src="../Js/jquery-1.4.2.min.js"></script>
    <script language="javascript" src="../Js/Core.js"></script>
    <script language="javascript" src="../Js/Main.js"></script>
    <script language="javascript" type="text/javascript">
        function openModelWin(sid, name, url) {
            switch (url) {
                case "SearchTrainList.aspx":
            var trainId=document.getElementById("<%=hidTraninClass.UniqueID%>");
            trainId.value=sid;
            var trainName=document.getElementById("<%=txtTraninClass.UniqueID%>");
            trainName.value=name;
            break;

        case "SearchClassRoomList.aspx":
           
            var chiddenObj = document.getElementById("<%=hidCoursewareIdList.UniqueID%>");
            chiddenObj.value = sid;
            var chidName = document.getElementById("<%=txtClassroomName.UniqueID%>")
            chidName.value = name;
           
            break;
                case "SearchTeacherList.aspx":
                    var chidThidId = document.getElementById("<%=hidTeacherIdList.UniqueID%>");
                    chidThidId.value = sid;
                    var chidTName = document.getElementById("<%=txtteacherName.UniqueID%>")
                    chidTName.value = name;
                    break;
                case "SearchCourseList.aspx":
                    var chidCourid = document.getElementById("<%=hidcourseIdList.UniqueID%>");
                    chidCourid.value = sid;
                    var chidCName = document.getElementById("<%=txtcourseName.UniqueID%>")
                    chidCName.value = name;
                    break;
                default:
                    break;                    
            }
        }
        function openwin(url) {
            switch (url) {
                case "SearchTrainList.aspx":
                    window.open("SearchTrainList.aspx", 'newwindow', 'toolbar=no,scrollbars=yes,resizable=no,top=20,left=300,width=700,height=600')
                                break;
                            case "SearchClassRoomList.aspx":
                    window.open("SearchClassRoomList.aspx", 'newwindow', 'toolbar=no,scrollbars=yes,resizable=no,top=20,left=300,width=700,height=600')

                    break;
                case "SearchTeacherList.aspx":
                    window.open("SearchTeacherList.aspx", 'newwindow', 'toolbar=no,scrollbars=yes,resizable=no,top=20,left=300,width=700,height=600')
                    break;
                case "SearchCourse.aspx":
                    window.open("SearchCourse.aspx?trianClassId=" + document.getElementById("hidTraninClass").value, 'newwindow', 'toolbar=no,scrollbars=yes,resizable=no,top=20,left=300,width=700,height=600')

                    break;
            }

        }
        function Clear(name) {
            switch (name) {
            case"train":
            document.getElementById("txtTraninClass").value = "";
                    document.getElementById("hidTraninClass").value = "";
            break;
        case "ClassRoom":
                    document.getElementById("txtClassroomName").value = "";
                    document.getElementById("hidCoursewareIdList").value = "";
                    break;
                case "Teacher":
                    document.getElementById("txtteacherName").value = "";
                    document.getElementById("hidTeacherIdList").value = "";
                    break;
                case "course":
                    document.getElementById("txtcourseName").value = "";
                    document.getElementById("hidcourseIdList").value = "";
                    break;
            }
        }

        function checkinfo(vl) {
        var hidtrianClass=document.getElementById("hidTraninClass").value;
        if (hidtrianClass == 0) {
            alert("请先选择培训班！")
            return false;
        }
        else {

            openwin('SearchCourse.aspx');
        }
    }
     
        
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <input type="hidden" runat="server"  id="hfInput" />
    <div class="zt mainCenter">
        <div class="contentBody">
        <div class="title">
        课程管理-->添加课程表
        </div>
            <table style="width:100%;color:#336699;"  class="ta1">
            <tr>
                   <td class="ta2 tag" >
                        培训班：
                    </td>
                    <td class="ta2">
                        <asp:TextBox ID="txtTraninClass" runat="server" CssClass="inp1" 
                           ></asp:TextBox>
                        <a href="#" onclick="openwin('SearchTrainList.aspx')"><img src="../images/wb_15.jpg" border="none" /></a>
                        <input id="hidTraninClass" runat="server" style="width: 10px" type="hidden" value="0" DataField="ClassName"/><img src="../Images/clear.jpg" onclick='Clear("train")'/>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                            ControlToValidate="txtClassroomName" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </td>
                </tr>
             <tr>
                    <td class="ta2 tag" >
                        教室：
                    </td>
                    <td class="ta2">
                        <asp:TextBox ID="txtClassroomName" runat="server" CssClass="inp1" ></asp:TextBox>
                        <a href="#" onclick="openwin('SearchClassRoomList.aspx')"><img src="../images/wb_15.jpg" border="none"/></a>
                        <input id="hidCoursewareIdList" runat="server" style="width: 10px" type="hidden" value="0" DataField="ClassRoom"/><img src="../Images/clear.jpg" onclick='Clear("ClassRoom")'/>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                            ControlToValidate="txtClassroomName" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                   <td class="ta2 tag" >
                        教师：
                    </td>
                    <td class="ta2">
                        <asp:TextBox ID="txtteacherName" runat="server" CssClass="inp1"  ></asp:TextBox>
                        <a href="#" onclick="openwin('SearchTeacherList.aspx')"><img src="../images/wb_15.jpg" border="none"/></a>
                        <input id="hidTeacherIdList" runat="server" type="hidden" value="0" DataField="ClassTeacher"/><img src="../Images/clear.jpg" onclick='Clear("Teacher")' />
                        <%--<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                            ControlToValidate="txtteacherName" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>--%>
                    </td>
                </tr>
                
                <tr>
                    <td class="ta2 tag">
                        课程：                     </td>
                    <td class="ta2">
                        <asp:TextBox ID="txtcourseName" runat="server" CssClass="inp1" ></asp:TextBox>
                        <a href="#" ><img src="../images/wb_15.jpg" onclick="return checkinfo()"border="none"/></a>
                        <input id="hidcourseIdList" runat="server" DataField="ClassCourse" style="width: 10px" type="hidden" value="0" /><img src="../Images/clear.jpg" onclick='Clear("course")' />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                            ControlToValidate="txtcourseName" ErrorMessage="*"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td class="ta2 tag">
                       课程开始日期：
                    </td>
                    <td class="ta2">
                        <asp:TextBox ID="txtbeginDate" runat="server" CssClass="inp1 Wdate" 
                            onfocus="new WdatePicker({dateFmt:('yyyy-MM-dd')})" DataField="ClassBeginDate"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                            ControlToValidate="txtbeginDate" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                
                <tr>
                    <td class="ta2 tag">
                        课程结束日期：
                    </td>
                    <td class="ta2">
                        <asp:TextBox ID="txtEndData" runat="server" CssClass="inp1 Wdate" 
                            onfocus="new WdatePicker({dateFmt:('yyyy-MM-dd')})" DataField="ClassEndDate"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                            ErrorMessage="*" ControlToValidate="txtEndData" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td class="ta2 tag">
                        课程开始时间：
                    </td>
                    <td class="ta2">
                        <asp:TextBox ID="txtbeginTime" runat="server" CssClass="inp1" DataField="ClassBeginTime"></asp:TextBox>
                        <asp:Label ID="lblManage" Text="HH:MM" runat="server"></asp:Label>
                       <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                            ControlToValidate="txtbeginTime" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                            ErrorMessage="hh:mm" ControlToValidate="txtbeginTime" 
                            ValidationExpression="^(([0-1]\d)|(2[0-4])):[0-5]\d$"></asp:RegularExpressionValidator>
                        <asp:Label ID="lblStar" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="ta2 tag">
                        课程结束时间：                   </td>
                    <td class="ta2">
                        <asp:TextBox ID="txtEndTime" runat="server" CssClass="inp1" DataField="ClassEndTime"></asp:TextBox>
                        <asp:Label ID="lblManage0" Text="HH:MM" runat="server"></asp:Label>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                            ControlToValidate="txtEndTime" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                            ControlToValidate="txtEndTime" ErrorMessage="hh:mm" 
                            ValidationExpression="^(([0-1]\d)|(2[0-4])):[0-5]\d$"></asp:RegularExpressionValidator>
                    </td>
                </tr>
            </table><%--
            <asp:Button ID="btnReg" runat="server" Text="确定" 
              CssClass="button" OnClientClick=" VideoNetSchool.Course.ChkCourse();" />--%>
            <input type="button"  value="确定" onclick="VideoNetSchool.Course.ChkCourse('a');" class="button" />
            <asp:Button ID="Button2" runat="server" Text="清空" CausesValidation="False" 
                CssClass="button" onclick="Button2_Click" />
            
            <asp:Button ID="btnReturn" runat="server" Text="返回"  CssClass="button" CausesValidation="False" 
                onclick="btnReturn_Click"/>
            
        </div>
    </div>
    <div>
    <span id="spanCoursewareList" style="color:#336600"></span>
    </div>
   </form>
</body>
</html>
